package chapter10.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ReaderTest {

	public static void main(String[] args) {
		File f = new File("D:/a.txt");
		if(f.exists() && f.canRead()){
			FileInputStream fis = null;
			try {
				fis = new FileInputStream(f);
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
			try {
				int len = fis.available();
				byte[] bits = new byte[1024];
				while (fis.read(bits) != -1) {
					System.out.print(new String(bits));	
				}
				fis.close();			
			} catch (IOException e) {
				e.printStackTrace();
			}
			
			
			
			
			
			
		}
	}

}
